{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "source": [
    "import math\r\n",
    "print(math.ceil(3.1))\r\n",
    "print(math.floor(4.6))\r\n",
    "print(math.fabs(-12.5))\r\n",
    "print(math.sqrt(49))\r\n",
    "print(math.exp(1))"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "4\n",
      "4\n",
      "12.5\n",
      "7.0\n",
      "2.718281828459045\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "source": [
    "import random\r\n",
    "print(random.random())\r\n",
    "print(random.randint(1,5))"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "0.3566599670504522\n",
      "2\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "source": [
    "a = \"20210829\"\r\n",
    "b = \"星期日\"\r\n",
    "print(a + b)\r\n",
    "print(a * 3)\r\n",
    "print(a[3])\r\n",
    "print(b[0:2])\r\n",
    "print('3' not in a)\r\n",
    "print('日' in b)\r\n",
    "print(' '.join(\"我是杨雨卓\"))"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "20210829星期日\n",
      "202108292021082920210829\n",
      "1\n",
      "星期\n",
      "True\n",
      "True\n",
      "我 是 杨 雨 卓\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "source": [
    "print('12345678')\r\n",
    "print(\"12345678\")\r\n",
    "print('''12345678''')\r\n",
    "print(\"这里有一个空隙\\t注意安全哦！\")\r\n",
    "text = '''\r\n",
    "<html>\r\n",
    "    <head>\r\n",
    "        <title>我是一只羊</title>\r\n",
    "        <style>\r\n",
    "            div {\r\n",
    "                width: 100px;\r\n",
    "                height: 100px;\r\n",
    "                background-color: green;\r\n",
    "            }\r\n",
    "        </style>\r\n",
    "    </head>\r\n",
    "    <body>\r\n",
    "        <div>这里是我的地盘！</div>\r\n",
    "    </body>\r\n",
    "</html>\r\n",
    "'''\r\n",
    "print(text)"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "12345678\n",
      "12345678\n",
      "12345678\n",
      "这里有一个空隙\t注意安全哦！\n",
      "\n",
      "<html>\n",
      "    <head>\n",
      "        <title>我是一只羊</title>\n",
      "        <style>\n",
      "            div {\n",
      "                width: 100px;\n",
      "                height: 100px;\n",
      "                background-color: green;\n",
      "            }\n",
      "        </style>\n",
      "    </head>\n",
      "    <body>\n",
      "        <div>这里是我的地盘！</div>\n",
      "    </body>\n",
      "</html>\n",
      "\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "source": [
    "list01 = [\"WO\", \"SHI\", \"LAMB\", \"FISH\", \"NAB\"]\r\n",
    "print(list01)\r\n",
    "print(list01[2])\r\n",
    "print(list01[4])\r\n",
    "print(list01[-1])\r\n",
    "print(list01[len(list01)-1])\r\n",
    "print(list01[-len(list01)])\r\n",
    "for lst01 in list01:\r\n",
    "    print(lst01)\r\n",
    "for lst02 in list01:\r\n",
    "    if lst02 == \"SHI\":\r\n",
    "        print(\"成功\")\r\n",
    "    else:\r\n",
    "        print(\"失败\")\r\n",
    "if \"SHI\" in list01:\r\n",
    "    print(\"成功\")\r\n",
    "else:\r\n",
    "    print(\"失败\")"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "['WO', 'SHI', 'LAMB', 'FISH', 'NAB']\n",
      "LAMB\n",
      "NAB\n",
      "NAB\n",
      "NAB\n",
      "WO\n",
      "WO\n",
      "SHI\n",
      "LAMB\n",
      "FISH\n",
      "NAB\n",
      "失败\n",
      "成功\n",
      "失败\n",
      "失败\n",
      "失败\n",
      "成功\n"
     ]
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "source": [
    "name = []\r\n",
    "print(name)\r\n",
    "name.append(\"yyz\")\r\n",
    "print(name)\r\n",
    "mode = [\"pop\", \"push\"]\r\n",
    "name.extend(mode)\r\n",
    "print(name)\r\n",
    "name.insert(0,\"chh\")\r\n",
    "print(name)"
   ],
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "[]\n",
      "['yyz']\n",
      "['yyz', 'pop', 'push']\n",
      "['chh', 'yyz', 'pop', 'push']\n"
     ]
    }
   ],
   "metadata": {}
  }
 ],
 "metadata": {
  "orig_nbformat": 4,
  "language_info": {
   "name": "python",
   "version": "3.9.6",
   "mimetype": "text/x-python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "pygments_lexer": "ipython3",
   "nbconvert_exporter": "python",
   "file_extension": ".py"
  },
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.9.6 64-bit"
  },
  "interpreter": {
   "hash": "b23ed511805502d1f463bd89c50b4ebd8bbef08b00bcefbe7d2d24d807191004"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}